package org.apache.servicecomb.samples.practise.houserush.customer.manage.aggregate;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @Author: Snake Man
 * @system:
 * @DateTime: 2022/1/19 22:00
 * @Description:
 */
@Data
@Entity
@Table(name = "qualifications")
@EntityListeners(AuditingEntityListener.class)
public class Qualification {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "customer_id")
    private Customer customer;

    private Integer saleId;

    @Transient
    private Integer houseId;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date UpdatedAt;

}
